<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      :class="{
        content4: props.info.value && !props.info.remarks && !props.info.subTitle,
        content3: !props.info.value && !props.info.remarks && props.info.subTitle,
        content2: !props.info.value && !props.info.remarks && !props.info.subTitle,
      }"
      class="content outline-parent-bg"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style15/Level1outlineStyle3Bg.webp'})`,
      }"
    >
      <div
        class="Showroom-parent"
        :class="{ 'Showroom-parent1': route.meta.loopType }"
        v-if="props.info.digitalShowroom"
      >
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div class="title-box">
        <span>{{ props.info.text }}</span>
      </div>
      <div class="center">
        <p
          class="subtitle"
          :class="{
            'subtitle-2': !props.info.value,
          }"
          v-if="props.info.subTitle"
        >
          ——{{ props.info.subTitle }}
        </p>

        <div class="remarks1" v-if="props.info.value">
          <TextMax
            :types="2"
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="getRemarksNum(4, route.meta.loopType)"
          ></TextMax>
        </div>
        <div
          class="remarks2"
          :class="{
            remarks3: !props.info.subTitle,
          }"
          v-else-if="props.info.remarks"
        >
          <TextMax
            :types="2"
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="!props.info.subTitle ? getRemarksNum(12, route.meta.loopType) : getRemarksNum(9, route.meta.loopType)"
          ></TextMax>
        </div>
        <div
          class="img-box"
          :class="{ 'img-box-mg': route.meta.loopType }"
          v-if="props.info.value"
          :style="{
            backgroundImage: `url(${
              publicUrls +
              (!props.info.remarks && !props.info.subTitle
                ? 'free/style15/Level1outlinestyle3cover2.webp'
                : 'free/style15/Level1outlinestyle3cover.webp')
            })`,
          }"
        >
          <div class="outline-cover">
            <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free15Style3',
});
</script>   
      
<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style15.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax15.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 200px;
  // margin-left: 120px;
  margin-top: 0;
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 564px;
  height: 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 170px 84px 50px 72px;
}
.content2 {
}
.content3 {
  // padding-top: 300px;
}
.content4 {
  .img-box {
    margin-left: -15px;
    // margin-top: 50px;
    height: 308px;
    .outline-cover {
      height: 298px;
      overflow: hidden;
    }
  }
  .img-box-mg {
    margin-top: 30px;
  }
}
.Showroom-parent {
  display: flex;
  position: absolute;
  top: 20px;
  right:61px;
  z-index: 15;
  width: 44px;
  height: 44px;
}
// .Showroom-parent1 {
//   top: 208.5px;
//   right: 39px;
// }
.title-box {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 408px;

  height: 96px;
  padding: 0 12px;

  font-family: SourceHanSerifCN-Bold;
  font-size: 32px;
  line-height: 48px;
  text-align: center;
  color: rgba(255, 226, 182, 1);

  span {
    width: 100%;
    text-shadow: 2px 3px 2px rgba(0, 0, 0, 0.3);
  }
}
.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 408px;
  height: 575px;
  padding: 89px 97px 0 83px;
  margin-top: 4px;
}
.subtitle {
  width: 200px;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  color: rgba(255, 255, 255, 1);
  font-family: SourceHanSerifCN;
}

.img-box {
  margin-top: 12px;
  display: flex;
  align-items: flex-end;
  // justify-content: center;
  position: relative;
  overflow: hidden;
  width: 228px;
  height: 138px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 218px;
    height: 128px;
    overflow: hidden;
    border-radius: 80px 0 80px 0;
    img {
      transition: all 0.3s;
      width: 218px;
      height: 100%;

      object-fit: cover;
      border-radius: 80px 0 80px 0;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.3);
    }
  }
}

.remarks1 {
  width: 228px;
  margin-top: 16px;
}
.remarks2 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 228px;
  height: 288px;
  margin-top: 16px;
}
.remarks3 {
  display: flex;
  // flex-direction: column;
  // justify-content: center;
  width: 228px;
  height: 384px;
  margin-top: 11px;
}
</style>
